// Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
//
// Licensed under the Mulan PSL v2.
// You can use this file according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of the License at
//
//     http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
// FOR MORE DETAILS.

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-11-05 14:22:29
 * @LastEditors: qiulin_JXGM ql1746365080@gmail.com
 * @LastEditTime: 2024-12-06 20:36:17
 * @FilePath: /SGSim/DBManager/Repository/HDF5/Input/Constraint/TEMPRepository.cpp
 */

#include "DBManager/Repository/HDF5/Input/Constraint/TEMPRepository.h"

#include "DBManager/Repository/HDF5/Base/HDF5RepositoryMacro.h"

HDF5_REG_REPOSITORY (TEMPRepository)

using namespace SG::DBManager::HDF5;

using namespace SG::DataStructure::FEM;

// 构造函数实现
TEMPRepository::TEMPRepository (HDF5Database& database) : SG::DBManager::HDF5::SingleSetRepositoryBase<TEMPData> (database)
{}

void TEMPRepository::InitialDatasetInfo ()
{
    RegisterIndex ("/OWN/INDEX/INPUT/CONSTRAINT/TEMP", IndexDataset, GetType ());
    RegisterTableInfo<TEMPData> ("/SG/INPUT/CONSTRAINT/TEMP", MainDataset);

    // 连接信号槽 当调用汇总的时候，将已有的缓存信息全部都持久化到HDF5文件中。
    GetDatabase ().GetHDF5Hub()->m_constraintSummarySignal.connect ([this] { Sort (); });
}
